package org.csu.mypetstore.persistence;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;

public interface ManageItemMapper {
    @Insert(" insert into Item(itemid,productid,listprice,unitcost,supplier,status,attr1,attr2,attr3,attr4,attr5)\n" +
            "        values(#{itemId},#{productId},#{listPrice},#{unitCost},#{supplierId},#{status},#{attribute1},#{attribute2},#{attribute3},#{attribute4},#{attribute5})")
    public void insertItem(String itemId,String productId,BigDecimal listPrice,BigDecimal unitCost,int supplierId,String status,String attribute1,String attribute2,String attribute3,String attribute4,String attribute5);

    @Update("update Item set productid = #{productId},listprice = #{listPrice},unitcost= #{unitCost},supplier = #{supplierId},status = #{status},attr1 = #{attribute1},attr2 = #{attribute2},attr3 = #{attribute3},attr4 = #{attribute4},attr5 = #{attribute5} where itemid = #{itemId}")
    public void updateItem(String itemId,String productId,BigDecimal listPrice,BigDecimal unitCost,int supplierId,String status,String attribute1,String attribute2,String attribute3,String attribute4,String attribute5);

    @Delete("delete from Item  where itemid = #{itemId}")
    public void deleteItem(String itemId);

}
